package com.demo.controller;

import com.demo.entity.CtFeedback;
import com.demo.entity.dto.CtFeedbackDto;
import com.demo.service.CtFeedbackService;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;

/**
 * (CtFeedback)表控制层
 *
 * @author makejava
 * @since 2021-07-03 12:10:10
 */
@RestController
@RequestMapping("ctFeedback")
public class CtFeedbackController {
    /**
     * 服务对象
     */
    @Resource
    private CtFeedbackService ctFeedbackService;

    /**
     *
     * @param ctFeedback
     * @return
     */
    @PostMapping("add")
    public CtFeedback insert(@RequestBody CtFeedback ctFeedback){
        return this.ctFeedbackService.insert(ctFeedback);
    }
    @GetMapping("findAll")
    public List<CtFeedback> findAll() {
        return ctFeedbackService.findAll();
    }
    @GetMapping("findOne")
    public CtFeedbackDto findById(int id) {
        return this.ctFeedbackService.findById(id);
    }
}
